// 组合因子暴露度
import React, { PureComponent } from 'react';
import { SecondHeaderC, QuickQueryC } from '../../../../../../comps';
import FactorExposure from '../../../../../performanceAnalysis/attributionAnalysis/Barra/factorExposure.js';
export default class CombinationExposure extends PureComponent {
  render() {
    const { searchData } = this.props;
    let querys = { ...searchData };
    delete querys.needPenetrate;
    delete querys.portfolioName;
    delete querys.timeRange;
    return (
      <div>
        <SecondHeaderC
          title='组合因子暴露度'
          Right={
            <QuickQueryC
              dataSource={[
                { value: '0', title: '绝对暴露度' },
                { value: '1', title: '超额暴露度' },
              ]}
              initialValue={'0'}
              onChange={(e) => {
                this.styleFactorExposure?.onChangeRadio(e), this.industryFactorExposure?.onChangeRadio(e);
              }}
            />
          }
        />
        <div style={{ marginBottom: '20px' }}>
          <FactorExposure args={querys} workingType='barra' title='组合风格因子暴露度' type='style' onRef={(ref) => (this.styleFactorExposure = ref)} height='220px' />
        </div>
        <div style={{ marginBottom: '20px' }}>
          <FactorExposure args={querys} workingType='barra' title='组合行业因子暴露度' type='industry' onRef={(ref) => (this.industryFactorExposure = ref)} height='220px' />
        </div>
      </div>
    );
  }
}
